package com.dly.blog.exception;

import com.dly.blog.content.ExceptionContent;
import lombok.Getter;

@Getter
public enum ChatExceptionEnum {

    CHAT_GET_CLIENT_ERROR(new ChatException(ExceptionContent.ChatException + 1, "获取gpt链接异常")),

    SSE_SEND_ERROR(new ChatException(ExceptionContent.ChatException + 2, "SSE 消息发送异常")),

    MESSAGE_IS_EMPTY(new ChatException(ExceptionContent.ChatException + 3, "发送的消息不能为空")),

    FREQUENCY_NOT_ENOUGH(new ChatException(ExceptionContent.ChatException + 4, "次数不够，请先购买次数")),

    FREQUENCY_CODE_NULL(new ChatException(ExceptionContent.ChatException + 5, "code 无效")),

    FREQUENCY_CODE_EMPTY(new ChatException(ExceptionContent.ChatException + 6, "code 不存在")),

    FREQUENCY_USER_EMPTY(new ChatException(ExceptionContent.ChatException + 7, "兑换人不存在")),

    FREQUENCY_NO_EMPTY(new ChatException(ExceptionContent.ChatException + 8, "无权创建兑换码"));

    private final ChatException chatException;

    ChatExceptionEnum(ChatException chatException){
        this.chatException = chatException;
    }

    public static class ChatException extends GlobalException{

        private static final String MODULE = "Chat";

        public ChatException(int code, String message) {
            super(code, message, MODULE);
        }
    }
}
